package com.lagou.stage04;

public class ProductTicketRunnable implements Runnable {
    private TicketStore ticketStore;
    public int addTicketNum;

    public ProductTicketRunnable(TicketStore ticketStore, int addTicketNum) {
        this.ticketStore = ticketStore;
        this.addTicketNum = addTicketNum;
    }
    @Override
    public void run() {
        while (true) {
            ticketStore.addTicketNum(addTicketNum);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
